﻿/*
**  Pair类
*/
if (!$.Engine.Collision || typeof $.Engine.Collision === "undefined") $.Engine.Collision = {};
$.Engine.Collision.Pair = function () { }
Object.extend($.Engine.Collision.Pair.prototype, {
  SetBuffered: function () { this.status |= $.Engine.Collision.Pair.e_pairBuffered; },
  ClearBuffered: function () { this.status &= ~$.Engine.Collision.Pair.e_pairBuffered; },
  IsBuffered: function () { return (this.status & $.Engine.Collision.Pair.e_pairBuffered) == $.Engine.Collision.Pair.e_pairBuffered; },

  SetRemoved: function () { this.status |= $.Engine.Collision.Pair.e_pairRemoved; },
  ClearRemoved: function () { this.status &= ~$.Engine.Collision.Pair.e_pairRemoved; },
  IsRemoved: function () { return (this.status & $.Engine.Collision.Pair.e_pairRemoved) == $.Engine.Collision.Pair.e_pairRemoved; },

  SetFinal: function () { this.status |= $.Engine.Collision.Pair.e_pairFinal; },
  IsFinal: function () { return (this.status & $.Engine.Collision.Pair.e_pairFinal) == $.Engine.Collision.Pair.e_pairFinal; },

  userData: null,
  proxyId1: 0,
  proxyId2: 0,
  next: 0,
  status: 0
});

$.Engine.Collision.Pair.nullPair = $.Engine.Settings.USHRT_MAX;
$.Engine.Collision.Pair.nullProxy = $.Engine.Settings.USHRT_MAX;
$.Engine.Collision.Pair.tableCapacity = $.Engine.Settings.maxPairs - 1;
$.Engine.Collision.Pair.tableMask = $.Engine.Collision.Pair.tableCapacity - 1;
$.Engine.Collision.Pair.e_pairBuffered = 0x0001;
$.Engine.Collision.Pair.e_pairRemoved = 0x0002
$.Engine.Collision.Pair.e_pairFinal = 0x0004;
